package com.tbit.uqbike.object.pojo.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.tbit.uqbike.annos.Excel;
import lombok.Data;

/**
 * 分账统计总览
 *
 * @Author:BUGTian
 * @DATE: 2022/5/26
 */
@Data
public class SubAccountLogOverviewVO {

    /**
     * 总订单金额
     */
    private Long rechargeMoneySum;

    /**
     * 总平台服务费
     */
    private Long serviceFeeSum;

    /**
     * 总可分账金额
     */
    private Long canBeSubMoneySum;

    /**
     * 账号
     */
    private String userNO;

    /**
     * 分账金额
     */
    private Long money;

    /**
     * 汇付手续费
     */
    private Long fee;

    /**
     * 汇付到账
     */
    private Long adPayMoney;

    /**
     * 其他平台到账
     */
    private Long otherMoney;

    /**
     * 时间
     */
    @Excel(name = "日期", sort = 1)
    private String addTime;

    /**
     * ===以下是导出相关转换===
     */
    @JSONField(serialize = false)
    @Excel(name = "订单总金额", sort = 2)
    private String rechargeMoneySumYuan;

    @JSONField(serialize = false)
    @Excel(name = "平台服务费(所有账号汇总)", sort = 3)
    private String serviceFeeSumYuan;

    @JSONField(serialize = false)
    @Excel(name = "可分账金额(所有账号汇总)", sort = 4)
    private String canBeSubMoneySumYuan;

    @JSONField(serialize = false)
    @Excel(name = "账号", sort = 5)
    private String nickName;

    @JSONField(serialize = false)
    @Excel(name = "分账金额", sort = 6)
    private String moneyYuan;

    @JSONField(serialize = false)
    @Excel(name = "汇付手续费", sort = 7)
    private String feeYuan;

    @JSONField(serialize = false)
    @Excel(name = "汇付到账", sort = 8)
    private String adPayMoneyYuan;

    /**
     * 单位转换
     */
    public void unitConversion() {
        this.rechargeMoneySumYuan = String.format("%.2f", ((double) rechargeMoneySum / 100D));
        this.serviceFeeSumYuan = String.format("%.2f", ((double) serviceFeeSum / 100D));
        this.canBeSubMoneySumYuan = String.format("%.2f", ((double) canBeSubMoneySum / 100D));
        this.moneyYuan = String.format("%.2f", ((double) money / 100D));
        this.feeYuan = String.format("%.2f", ((double) fee / 100D));
        this.adPayMoneyYuan = String.format("%.2f", ((double) adPayMoney / 100D));
    }
}
